1. Technical Field
The present invention relates to networks, and more particularly, to credit management in network systems.
2. Related Art
Networks typically use frames or packets (used interchangeably through out this specification) to send information (or data) between network nodes. A network node is a port for a network device (for example, a switch, host bus adapter and others). A network node that transmits a frame may be designated as a “transmitting node” and a network node that receives a frame may be designated as a “receiving node”
Typically, before a transmitting node sends a frame to a receiving node, the transmitting node ensures that there is enough credit at the receiving node to receive and store the frame. The transmitting node and the receiving node may go through a handshake mechanism to determine if space (or credit) is available for a frame. The handshake mechanism is often determined by the network protocol/standard. For example, in a Fibre Channel network, the receiving node sends a primitive, R_RDY, to the transmitting node, to indicate availability of storage space (or buffer space) at the receiving node. After receiving the R_RDY primitive, the transmitting node transmits a frame to the receiving node.
Typically, when a receiving node receives a frame, the frame is stored (or staged) in a receive buffer (or memory storage space). The receive buffer includes a plurality of slots. The receive buffer allocates one slot for each frame, regardless of the frame size. For example, each entry in a receive buffer may be 2164 bytes, which is the maximum Fibre Channel frame size. A frame that is smaller in size than the maximum frame size (for example, 256 bytes) occupies the same slot as a maximum size frame. Therefore, buffer space utilization is inefficient in conventional network nodes.
Conventional network nodes have other shortcomings. For example, when a network node receives a larger frame (for example, 2164 bytes), the frame is stored in a slot of the receive buffer. Depending on the destination port, the received frame is moved to a transmit port for transmission. While the node is processing the larger frame, other short frames may arrive and fill up the receive buffer. This may cause a buffer overflow condition. The overflow condition may result in frames being dropped. This may affect overall network performance. The problem gets severe for network links that are longer, for example, more than one kilometer.
Therefore, there is a need to improve network frame processing and overall network node structure for handling frames of different sizes.